var o = require("G");
cc.Class({
    extends: cc.Component,
    properties: {
        failNode: cc.Node,
        gold: cc.Node
    },
    onLoad: function () {
        var t = this;
        this.shareinfolist = [], o.Interface.onShow(function (e) {
            switch (parseInt(e.type)) {
                case 0:
                    console.log("0");
                    break;

                case 1:
                    console.log("1"), t.isShareOk(t.getGold.bind(t));
                    break;

                case 2:
                    console.log("2"), t.isShareOk(t.revive.bind(t));
            }
        }.bind(this));
    },
    isShareOk: function (t) {
        var e = (Date.parse(new Date()) - o.t1) / 1e3;
        console.log("last time: ", e), e > 2 ? t() : o.Interface.hitBox("分享失败，请换个群重试。");
    },
    getGold: function () {
        console.log("分享成功，获取金币"), this.gold.getComponent("Gold").moveAnimation(), o.Interface.hitBox("获得10个金币");
    },
    revive: function () {
        this.failNode.active ? (console.log("分享成功，执行复活"), this.failNode.getComponent("Fail").revive()) : o.Interface.hitBox("无效场景");
    }
})